#ifndef ssl_h
#define ssl_h

#include <stdlib.h>
#include <string>

#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/bio.h>

#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")

class CSSL{
public:
	CSSL();
	~CSSL();
	bool initialize(const char * n_cacrt);

private:
	BIO * m_bio;
	SSL * m_ssl;
	SSL_METHOD * m_meth;
	SSL_CTX * m_ctx;

public:
	bool connect(const char * n_Addr, const int n_Port);
	int send(char * buf, const int len);
	int receive(char * buf, const int len);
};

#endif